10 research outputs found

    The TTC 2014 Movie Database Case: Rascal

    Get PDF
    Rascal is a meta-programming language for processing source code in the broad sense (models, doc- uments, formats, languages, etc.). In this short note we discuss the implementation of the “TTC’14 Movie Database Case” in Rascal. In particular we will highlight the challenges and benefits of using a functional programming language for transforming graph-based models

    Modular interpreters with implicit context propagation

    Get PDF
    Modular interpreters are a crucial first step towards component-based language development: instead of writing language interpreters from scratch, they can be assembled from reusable, semantic building blocks. Unfortunately, traditional language interpreters can be hard to extend because different language constructs may require different interpreter signatures. For instance, arithmetic interpreters produce a value without any context information, whereas binding constructs require an additional environment.In this paper, we present a practical solution to this problem based on implicit context propagation. By structuring denotational-style interpreters as Object Algebras, base interpreters can be retroactively lifted into new interpreters that have an extended signature. The additional parameters are implicitly propagated behind the scenes, through the evaluation of the base interpreter.Interpreter lifting enables a flexible style of modular and extensible language development. The technique works in mainstream object-oriented languages, does not sacrifice type safety or separate compilation, and can be easily automated, for instance using macros in Scala or dynamic proxies in Java. We illustrate implicit context propagation using a modular definition of Featherweight Java and its extension to support side-effects, and an extensible domain-specific language for state machines. We finally investigate the performance overhead of lifting by running the DeltaBlue benchmark program in Javascript on top of a modular implementation of LambdaJS and a dedicated micro-benchmark. The results show that lifting makes interpreters roughly twice as slow because of additional call overhead. Further research is needed to eliminate this performance penalty

    Evolving Languages with Object Algebras

    Get PDF
    Object Algebras are a programming technique for the extensible implementation of recursive data types. This extended abstract introduces Object Algebras and shows how they could be used to develop highly evolvable software languages. The paper is concluded with a discussin of directions for further research

    Tracing program transformations with string origins

    Get PDF
    Program transformations play an important role in domain-specific languages and model-driven development. Tracing the execution of such transformations has well-known benefits for debugging, visualization and error reporting. In this paper we introduce string origins as a lightweight, generic and portable technique to establish a tracing relation between the textual fragments in the input and output of a program transformation. We discuss the semantics and the implementation of string origins using the Rascal meta programming language as an example. Furthermore, we illustrate the utility of string origins by presenting data structures and operations for tracing generated code, implementing protected regions, performing name resolution, and fixing inadvertent name capture in generated code

    Extensible modeling with managed data in Java

    Get PDF
    Many model-driven development (MDD) tools employ specialized frameworks and modeling languages, and assume that the semantics of models is provided by some form of code generation. As a result, programming against models is cumbersome and does not integrate well with ordinary programming languages and IDEs. In this paper we present MD4J, a modeling approach for embedding metamodels directly in Java, using plain interfaces and annotations. The semantics is provided by data managers that create and manipulate models. This architecture enables two kinds of extensibility. First, the data managers can be changed or extended to obtain different base semantics of a model. This allows a kind of aspect-oriented programming. Second, the metamodels themselves can be extended with additional fields and methods to modularly enrich a modeling language. We illustrate our approach using the example of state machines, discuss the implementation, and evaluate it with two case-studies: The execution of UML activity diagrams and an aspect-oriented refactoring of JHotDraw

    Structuring languages as object-oriented libraries

    Get PDF
    The development of programming languages is challenging because the typical language processing toolchain consists of different artifacts interacting with each other. The ideal scenario for engineering languages is one closer to traditional software engineering, where reuse, in the form of frameworks and libraries, has optimized development times. In the case of programming language engineering, there is a tension between extending the syntax and adding new operations to a language. This tension in terms of extensibility is concisely summarized in the Expression Problem. Object Algebras solve the Expression Problem in the context of object-oriented programming, requiring only inheritance and parametric polymorphism from the host language. This thesis postulates that, given their advantages in terms of modularity and extensibility, Object Algebras are a suitable technique for structuring libraries of languages, making reuse a central practice in the implementation of languages. This dissertation thus introduces applications of the Object Algebra pattern for implementing language libraries: Recaf, a framework for defining libraries of Java dialects, and Modular Interpreters with Implicit Context Propagation, a technique to compose language interpreters with different context requirements. As supporting mechanisms we introduce String Origins, a technique to trace the results of program transformations back to their origins, and JEff, a language that integrates object orientation with effects and handlers, as a first step towards an object-oriented language that could host effectful modular interpreters. The results described in this dissertation show that object orientation, and Object Algebras in particular, provides a fertile foundation for the vision of library-based language development
    corecore